package net.hn.hnms.biz.gasext.dws.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.hn.hnms.biz.gasext.dws.domain.fineData.DwmcEntity;
import net.hn.hnms.biz.gasext.dws.domain.fineData.InsertShiftManage1Po;
import net.hn.hnms.biz.gasext.dws.domain.fineData.ShiftManagementPo;
import net.hn.hnms.biz.gasext.dws.service.FineDataService;
import net.hn.hnms.sys.common.core.domain.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/fineData")
@Api(tags = {"帆软数据接口"})
public class FineDataController {


    @Resource
    private FineDataService fineDataService;


    // 获取帆软数据编码
    @GetMapping("getFineDataCode")
    @ApiOperation("获取帆软数据编码及煤矿名称")
    public R<List<DwmcEntity>> getFineListByCode(@ApiParam(value = "煤矿编码")String mineCode) {
        List<DwmcEntity> fineData = fineDataService.getFineListByCode(mineCode);
        return R.ok(fineData);
    }

    /**
     * 根据煤矿名称获取当天煤矿带班和值班记录
     * @param mineName
     * @return
     */
    @ApiOperation("根据煤矿名称获取当天煤矿带班和值班记录")
    @GetMapping("getFineDataBeOnWatchListBymineName")
    public R<List<ShiftManagementPo>> getFineDataBeOnWatchListBymineName(@ApiParam(value = "煤矿名称")String mineName) {
        List<ShiftManagementPo> fineData = fineDataService.getFineDataBeOnWatchListBymineName(mineName);
        return R.ok(fineData);
    }

    /**
     * 根据煤矿名称获取煤矿班次记录
     * @param mineName
     * @return
     */
    @ApiOperation("根据煤矿名称获取煤矿班次记录")
    @GetMapping("getFineDataClassListBymineName")
    public R<List<InsertShiftManage1Po>> getFineDataClassListBymineName(@ApiParam(value = "煤矿名称")String mineName) {
        List<InsertShiftManage1Po> fineData = fineDataService.getFineDataClassListBymineName(mineName);
        return R.ok(fineData);
    }

}
